﻿using AutoMapper;
using EquipmentModule.Contracts;
using EquipmentModule.Entity;
using EquipmentModule;
using EquipmentModule.ViewModel;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using System.IO;
using NPOI.OpenXmlFormats.Dml.Chart;

namespace EquipmentModule.Controllers
{
    [ApiController]
    [Route("Equipment/[controller]")]
    public class DashboardController : ControllerBase
    {
        private readonly ILogger _logger;

        private readonly IWebHostEnvironment _env;
        private readonly IDashboardService _service;
        private readonly IMapper _mapper;

        public DashboardController(IMapper mapper,ILogger<HistoryController> logger, IWebHostEnvironment env, IDashboardService service)
        {
            _logger = logger;
            _env = env;
            _service = service;
            _mapper = mapper;
        }
        [HttpGet("RiverHistory")]
        public IActionResult Index()
        {
            string db = Common.GetHeader4DB(this.Request);
            //db = "soadb1597154229";
            var data = _service.Index(db).ToList();
            return Ok(new ResponseData(null, data));
        }

    }
}
